import pymongo
import datetime
myclient = pymongo.MongoClient('mongodb://10.10.24.146:27017')
mycol = myclient['test']['movie']

mydict = {"name":"矮婆","grade":"7.7","year":"2018","url":"https://movie.douban.com/subject/26752088/?tag=%E8%B1%86%E7%93%A3%E9%AB%98%E5%88%86&from=gaia_video","uploader":"汪骏阳"}

#x = mycol.insert_one(mydict)
#for x in mycol.find():
#    print(x)
    
myquery = {"name":"矮婆","uploader":"zjn"}
 
x = mycol.delete_many(myquery)
 
print(x.deleted_count, "个文档已删除")

#myquery = {"name": "矮婆","uploader":"汪骏阳"}
#newvalues = {"$set":{"name":"矮婆","uploader":"zjn"}}
 
#mycol.update_one(myquery, newvalues)
 
# 输出修改后的  "sites"  集合
#for x in mycol.find():
#  print(x)